package com.huc.tools.constant;

import lombok.Getter;
import lombok.Setter;

/**
 * @Author: 胡成
 * @Version: 0.0.1V
 * @Date: 2018/8/6
 * @Description: mongodb枚举
 **/
public enum MongoDbEnum {

    MONGO_DATABASE_MYCOL_USER_LOGIN_LOG("mycol","user_login_log");

    @Setter
    @Getter
    private String database;

    @Setter
    @Getter
    private String coll;

    MongoDbEnum(String database,String coll){
        this.database = database;
        this.coll = coll;
    }

    public static MongoDbEnum get(String key) {
        for (MongoDbEnum c : MongoDbEnum.values()) {
            if (c.database == key) {
                return c;
            }
        }
        return null;
    }

}
